Log Analyzer - AWstats
2013/05/12 |
Install AWstats that is Apache Log analyzer.
|
|
[1] | Install AWstats |
root@www:~#
aptitude -y install awstats
root@www:~#
vi /etc/awstats/awstats.conf # line 122: change # If your config for log format in httpd.conf is 'combined' Set here '1' # If log-config is 'common' set here '4', but in this case, some informations can't be get (browser info and so on) LogFormat= 1
# line 153: specify hostname SiteDomain=" www.srv.world "
# line 168: set IP address you'd like to exclude HostAliases="localhost 127.0.0.1 REGEX[server\.world$] REGEX[^10\.0\.0\.] "
# line 222: change DirIcons=" ./icon "
mkdir /var/www/awstats root@www:~# ln -s /usr/share/awstats/icon /var/www/awstats/icon
root@www:~#
vi /etc/apache2/sites-available/default <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from 10.0.0.0/24 # IP address you permit </Directory> # add these lines
<Location /awstats> Order deny,allow Deny from all Allow from 10.0.0.0/24 # IP address you permit </Location>
</VirtualHost>
root@www:~#
/etc/init.d/apache2 restart * Restarting web server apache2 ... waiting ...done. # generate reports root@www:~# /usr/lib/cgi-bin/awstats.pl -config=apache -update Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 7.1 (build 1.982) From data in log file "/var/log/apache2/access.log"... Phase 1 : First bypass old records, searching new record... Searching new records from beginning of log file... Phase 2 : Now process new records (Flush history on disk after 20000 hosts)... Jumped lines in file: 0 Parsed lines in file: 16 Found 0 dropped records, Found 0 comments, Found 0 blank records, Found 0 corrupted records, Found 0 old records, Found 16 new qualified records. # generate HTML reports from the reports above root@www:~# /usr/lib/cgi-bin/awstats.pl -config=apache -output -staticlink > /var/www/awstats/index.html |
[2] | Access to 'http://(your server's name or IP address)/awstats/', then follwing sacreen is shown and it's possible to see Apache's logs. |